主要用伪代码&自然语言
Greedy Algorithm
Definition of MST
Generic MST algorithm
GENERIC_MST(G, w)1 A:={}
2 while A does not form a spanning tree do
3 find an edge (u,v) that is safe for A
4 A:=A∪{(u,v)}
5 return A
In Kruskal’s algorithm,
In Prim’s algorithm,